

export class Constant {
    static readonly ERROR = "error"
    static readonly DEFAULT = "default"
    static readonly LOADING = "loading"
    static readonly SUCCESS = "success"
    static readonly INFO = "info"
    static readonly WARNING = "warning"

    static readonly FOLDER_MUSIC: string = "music/"
    static readonly FOLDER_IMG: string = "img/"
    static readonly FOLDER_LRC: string = "lrc/"
}

export class Advice {
    static readonly ERROR = "error"
    static readonly DEFAULT = "default"
    static readonly SUCCESS = "success"
    static readonly INFO = "info"
    static readonly WARNING = "warning"
}


export class MyUrl {
    static readonly BACKEND_IP = "http://" + location.hostname + ":8080"

    //Song
    static readonly SONG_getSongList = this.BACKEND_IP + "/song/getSongList"
    static readonly SONG_addSong = this.BACKEND_IP + "/song/addSong"
    static readonly SONG_updateSong = this.BACKEND_IP + "/song/updateSong"
    static readonly SONG_getSongPage = this.BACKEND_IP + "/song/getSongPage"
    static readonly SONG_deleteSong = this.BACKEND_IP + "/song/deleteSong"
    static readonly SONG_findSongById = this.BACKEND_IP + "/song/findSongById"
    static readonly SONG_findSongByPlaylistId = this.BACKEND_IP + "/song/findSongByPlaylistId"
    static readonly SONG_findSongByKeyword = this.BACKEND_IP + "/song/findSongByKeyword"
    static readonly SONG_getSongPageByKeyword = this.BACKEND_IP + "/song/getSongPageByKeyword"
    static readonly SONG_getNewSongFromEs = this.BACKEND_IP + "/song/getNewSongFromEs"

    //User
    static readonly USER_login = this.BACKEND_IP + "/user/login"
    static readonly USER_findUserById = this.BACKEND_IP + "/user/findUserById"
    static readonly USER_register = this.BACKEND_IP + "/user/register"
    static readonly USER_findUserByKeyword = this.BACKEND_IP + "/user/findUserByKeyword"
    static readonly USER_updateUser = this.BACKEND_IP + "/user/updateUser"
    static readonly USER_getUserPageByKeyword = this.BACKEND_IP + "/user/getUserPageByKeyword"
    static readonly USER_findUserByPlaylistId = this.BACKEND_IP + "/user/findUserByPlaylistId"
    static readonly USER_forgetPasswordCheckCode = this.BACKEND_IP + "/user/forgetPasswordCheckCode"
    static readonly USER_forgetPasswordCreateCodeByEmail = this.BACKEND_IP + "/user/forgetPasswordCreateCodeByEmail"
    static readonly USER_checkEmail = this.BACKEND_IP + "/user/checkEmail"
    static readonly USER_editPasswordByEmail = this.BACKEND_IP + "/user/editPasswordByEmail"

    //Favorite
    static readonly FAVORITE_getFavoriteByUserId = this.BACKEND_IP + "/favorite/getFavoriteByUserId"
    static readonly FAVORITE_findFavoriteSongByUserId = this.BACKEND_IP + "/favorite/findFavoriteSongByUserId"
    static readonly FAVORITE_findFavoritePlaylistByUserId = this.BACKEND_IP + "/favorite/findFavoritePlaylistByUserId"
    static readonly FAVORITE_deleteFavoriteSongByUserId = this.BACKEND_IP + "/favorite/deleteFavoriteSongByUserId"
    static readonly FAVORITE_deleteFavoritePlaylistByUserId = this.BACKEND_IP + "/favorite/deleteFavoritePlaylistByUserId"
    static readonly FAVORITE_addSongToFavorite = this.BACKEND_IP + "/favorite/addSongToFavorite"
    static readonly FAVORITE_addPlaylistToFavorite = this.BACKEND_IP + "/favorite/addPlaylistToFavorite"
    static readonly FAVORITE_checkSongIsFavorite = this.BACKEND_IP + "/favorite/checkSongIsFavorite"
    static readonly FAVORITE_checkPlaylistIsFavorite = this.BACKEND_IP + "/favorite/checkPlaylistIsFavorite"


    //Playlist
    static readonly PLAYLIST_findPlaylistByUserId = this.BACKEND_IP + "/playlist/findPlaylistByUserId"
    static readonly PLAYLIST_addPlaylist = this.BACKEND_IP + "/playlist/addPlaylist"
    static readonly PLAYLIST_addPlaylistSong = this.BACKEND_IP + "/playlist/addPlaylistSong"
    static readonly PLAYLIST_findPlaylistById = this.BACKEND_IP + "/playlist/findPlaylistById"
    static readonly PLAYLIST_findPlaylistByKeyword = this.BACKEND_IP + "/playlist/findPlaylistByKeyword"
    static readonly PLAYLIST_getPlaylistPageByKeyword = this.BACKEND_IP + "/playlist/getPlaylistPageByKeyword"
    static readonly PLAYLIST_deletePlaylistById = this.BACKEND_IP + "/playlist/deletePlaylistById"
    static readonly PLAYLIST_deleteSongFromPlaylist = this.BACKEND_IP + "/playlist/deleteSongFromPlaylist"
    static readonly PLAYLIST_updatePlaylist = this.BACKEND_IP + "/playlist/updatePlaylist"
    static readonly PLAYLIST_findPlaylistByIdAndUserId = this.BACKEND_IP + "/playlist/findPlaylistByIdAndUserId"


    //Lyrics
    static readonly LYRICS_addLyrics = this.BACKEND_IP + "/lyrics/addLyrics"
    static readonly LYRICS_getLyricsById = this.BACKEND_IP + "/lyrics/getLyricsById"
    static readonly LYRICS_updateLyrics = this.BACKEND_IP + "/lyrics/updateLyrics"

    //Comments
    static readonly COMMENTS_findCommentListFromCommentsBySongId = this.BACKEND_IP + "/comments/findCommentListFromCommentsBySongId"
    static readonly COMMENTS_findReplyListFromCommentsByReplyId = this.BACKEND_IP + "/comments/findReplyListFromCommentsByReplyId"
    static readonly COMMENTS_addComments = this.BACKEND_IP + "/comments/addComments"
    static readonly COMMENTS_deleteCommentsById = this.BACKEND_IP + "/comments/deleteCommentsById"
}


export class Song {
    id: number
    name: string
    singer: string
    lyricist: string
    composer: string
    remark: string
    userId: number
    lyricsId: number
    url: string
    createdAt: string
    updatedAt: string
}

export class Playlist {
    id: number
    name: string
    remark: string
    userId: number
    createdAt: string
    updatedAt: string

    constructor(name?: string, remark?: string, userId?: number) {
        this.name = name
        this.remark = remark
        this.userId = userId
    }
}

export class Lyrics {
    id: number
    name: string
    userId: number
    url: string
    createdAt: string
    updatedAt: string

    constructor(name?: string, userId?: number, url?: string) {
        this.name = name
        this.userId = userId
        this.url = url
    }
}

